package com.thb.pay.api.sys;


import com.thb.pay.api.sys.fallback.SysRoleServiceApiFallbackFactory;
import com.thb.pay.api.sys.vo.req.SysRolePageReq;
import com.thb.pay.api.sys.vo.req.SysRoleReq;
import com.thb.pay.api.sys.vo.resp.SysRoleVo;
import com.thb.pay.core.utils.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <p>
 * 系统-角色表 前端控制器
 * </p>
 *
 * @author lucky
 * @since 2019-07-21
 */
@FeignClient(value = "pay-service", fallbackFactory = SysRoleServiceApiFallbackFactory.class)
@RequestMapping("/sysRoleApi")
public interface SysRoleServiceApi {

    @RequestMapping(value = "/findPage", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    PageResult<SysRoleVo> findPage(@RequestBody SysRolePageReq pageReq);

    @RequestMapping(value = "/addRole", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void addRole(@RequestBody SysRoleReq sysRole);

    @RequestMapping(value = "/updateRole", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void updateRole(@RequestBody SysRoleReq sysRole);

    @RequestMapping(value = "/getByRoleId", method = RequestMethod.GET)
    SysRoleVo getByRoleId(@RequestParam("roleId") Long roleId);

    @RequestMapping(value = "/findAllRoles", method = RequestMethod.GET)
    List<SysRoleVo> findAllRoles();


    @RequestMapping(value = "/deleteBatchRoleIds", method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
    void deleteBatchRoleIds(@RequestBody List<Long> roleIds);
}
